<?php
switch ($_GET['req']) {
	case 'appgoodinfo':
		$id=explode('_',$_GET['id']);
               $_POST['id']=$_GET['id'];//goodid
               $pinfor=explode('_',$_GET['dealline']);
               $_POST['orderid']=$pinfor[0];//dealline
               $_POST['splitid']=$pinfor[1];$_GET['splitid'];//splitid
                //查询货品信息、代理商信息、厂商信息
               $modelClass = 'app\com\simtoon\publicmodels\GoodInfor';
               $data=YiiComm::executeByMethod($modelClass,'BasicInfor',$_POST);
               $infor=$data->getModels();
               $baseinfor=$infor[0];

               //拆分后的体积
               if(!empty($_POST['splitid'])){
               	$baseinfor['volume']=($baseinfor['packageleng']/1000)*($baseinfor['packagewidth']/1000)*($baseinfor['packageheight']/1000);
               	$baseinfor['volume']=round($baseinfor['volume'],3);
               }
               //信息异常
               if(empty($baseinfor)){
                    $abnormality=1;
               }else{
                     $abnormality=0;
               }
               //入库及操作人员信息
               $data=YiiComm::executeByMethod($modelClass,'warehousing',$_POST);
               $infor=$data->getModels();
               $ware=$infor[0];
               //未入库
               if(empty($ware)){
                   $ku=1;
               }else{
                  $ku=0;
               }
               //异常信息
               $data=YiiComm::executeByMethod($modelClass,'abnormality',$_POST);
               $infor=$data->getModels();
               $ycinfor=$infor[0];
               //无异常信息
               if(empty($ycinfor)){
                   $yi=1;
               }else{
                  $yi=0;
               }
               switch($ycinfor['state']){
               	   case 0 :
               	   	   $ycinfor['state']='不做处理';
               	   	   break;
               	   case 1:
               	   	   $ycinfor['state']='处理中';
               	   	   break;
               	   case 2:
               	   	   $ycinfor['state']='返厂维修';
               	   	   break;
               	   case 3:
               	   	   $ycinfor['state']='发新件';
               	   	   break;
               	   case 4:
               	   	   $ycinfor['state']='就地维修';
               	   	   break;
               	   case 6:
               	   	   $ycinfor['state']='处理中';
               	   	   break;
               	   case 5:
               	   	   $ycinfor['state']='无原因';
               	   	   break;
               	   case 7:
               	   	   $ycinfor['state']='返厂成功';
               	   	   break;
               }
		include template('public/tpl/appgoodinfo.html',1);
		break;
	default:
		# code...
		break;
}


?>